<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <!--公共样式-->
    <link href="${pageContext.request.contextPath }/web/css/font/iconfont.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/web/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/NormalizeFile.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/public.css" />
    <!--列表页面私有样式-->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/subpage/list.css" /><!--分页-->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/subpage/person.css" />
</head>
<body class="w928">
    <!--用户中心 begin-->
        <!--我的订单-->
         <c:if test="${fn:length(listorder)==0}">
        <div class="right-content bor1 font1">
            <div class="bor1-t xx-top">
            	<spring:message code="dangqianmeiyoudingdan"></spring:message>
            </div>
           </div>
           </c:if> 
        <c:if test="${fn:length(listorder)>0}">
        <div class="right-content bor1 font1">
            <div class="bor1-t xx-top">
               <spring:message code="member.myOrder"></spring:message>
            </div>
            <div class="bor1-t order-content">
                <div class="table-top bor1 bor-t0 h50 line-h50">
                    <span class="or1"><spring:message code="order.orderInfo"></spring:message></span>
                    <span class="or2"><spring:message code="order.orderMeters"></spring:message></span>
                    <span class="or3"><spring:message code="order.orderPrice"></spring:message></span>
                    <span class="or4"><spring:message code="order.classification"></spring:message></span>
                    <span class="or5"><spring:message code="order.transactionStatus"></spring:message></span>
                    <span class="or6"><spring:message code="order.operation"></spring:message></span>
                </div>

                <c:forEach var="list" items="${listorder}">
                <div class="order-wei">
                    <div class="order-top bor1 bor-t0 h50 line-h50"><spring:message code="order.orderNo"></spring:message>：${list.orders.O_NO }</div>
                    <div class="order-content-wei">
                        <div class="f-l or-left">
                            <ul>
                             <c:forEach items="${list.orderlist}" var="item">
                             <li>
                                    <div class="or8">
                                     <c:choose>
										<c:when test="${item.OL_TYPE!=3}">
						                <a target="_top" href="${pageContext.request.contextPath}/web/patternfilter/viewpattern?pNo=${item.OL_PATTERN_NO}"><img src="${item.OL_PATTERN_IMG}" /></a>
						                </c:when>
						                <c:when test="${item.OL_TYPE==3}">
						                <a target="_top" href="${pageContext.request.contextPath}/web/patternfilter/viewf?fNo=${item.OL_FABRIC_NO}"><img src="${pageContext.request.contextPath }/upload/${item.MESSAGE3}" /></a>
						             </c:when>
						             <c:otherwise>
						               <img src="${pageContext.request.contextPath }/web/img/bl2.jpg" />
						             </c:otherwise>
						             </c:choose>
                                    </div>
                                    <div class="or7">
                                    <c:choose>
									<c:when test="${item.OL_TYPE==0}">
									 <p class="zichang" style="line-height:48px;"><spring:message code="pattern"></spring:message>：<span title="${item.OL_PATTERN_NO}">${item.OL_PATTERN_NO}</span>
									  <br/> <span title="${item.PP_NAME}">${item.PP_NAME}</span>
                                           </p>
									</c:when>
									<c:when test="${item.OL_TYPE==1}">
									 <p class="zichang" style="line-height:100px;"><spring:message code="pattern"></spring:message>：<span title="${item.OL_PATTERN_NO}">${item.OL_PATTERN_NO}</span>
                                            </p>
									</c:when>
									<c:when test="${item.OL_TYPE==2}">
									 <p class="zichang" style="line-height:35px;"><spring:message code="pattern"></spring:message>：<span title="${item.OL_PATTERN_NO}">${item.OL_PATTERN_NO}</span>
                                            <br/>
                                               	<spring:message code="order.fabric"></spring:message>：${item.OL_FABRIC_NO}<br/>
                                               	 <span title="${item.PP_NAME}">${item.PP_NAME}</span>
                                               	 </p>
									</c:when>
									<c:when test="${item.OL_TYPE==3}">
									<p class="zichang" style="line-height:100px;">
                                               	 <spring:message code="order.fabric"></spring:message>：<span title="${item.OL_FABRIC_NO}">${item.OL_FABRIC_NO}</span>
                                               	 </p>
									</c:when>
									</c:choose> 
									
                                    </div>
                                    <div class="or2">
                                         ${item.OL_FABRIC_SIZE}<spring:message code="mi"></spring:message>
                                    </div>
                                    <div class="or3">
                                      	  ￥<fmt:formatNumber pattern="0.00"  value="${item.MESSAGE2 + 0.0001}"/>
                                    </div>
                                    <div class="or4">
                                 	<c:choose>
									<c:when test="${item.OL_TYPE==0}">
									<spring:message code="order.printing"></spring:message>
									
									</c:when>
									<c:when test="${item.OL_TYPE==1}">
									<spring:message code="order.buyout"></spring:message>
									</c:when>
									<c:when test="${item.OL_TYPE==2}">
									<spring:message code="order.finishedProduct"></spring:message>
									
									</c:when>
									<c:when test="${item.OL_TYPE==3}">
									<spring:message code="order.fabric"></spring:message>
									</c:when>
									</c:choose> 
                                    </div>
                                </li>
                            			</c:forEach>
                            </ul>
                        </div>
                        <div class="f-l or-right">
                            <span class="or5">
								 <c:choose>
									<c:when test="${list.orders.O_STATE==0}">
									<spring:message code="order.notPaying"></spring:message>
									</c:when>
									<c:when test="${list.orders.O_STATE==1}">
									 <spring:message code="order.paymentHasBeen"></spring:message>
									</c:when>
									<c:when test="${list.orders.O_STATE==2}">
									<spring:message code="order.haveTheGoods"></spring:message>
									</c:when>
								</c:choose> 

							</span>
                            <span class="or6">
                                <a href="${pageContext.request.contextPath }/web/orders/orderDetailToPaid${list.orders.O_ID}" class="a-detail"><spring:message code="order.orderDetails"></spring:message>
                               </a></br>
                                <a href="javascript:del(${list.orders.O_ID})" class="a-delete"><spring:message code="order.deleteOrder"></spring:message></a>
                            </span>
                        </div>
                        <div class="clr"></div>
                    </div>
                </div>
				</c:forEach> 
                <div class="page-order">
                    <button type="button" onclick="shangyiye()" class="before-page" ${pageInfo.page<=1?'disabled="disabled"':''} style="margin: 9px 0 9px 314px;"><spring:message code="order.previousPage"></spring:message></button>
                    <button type="button" onclick="xiayiye()" ${pageInfo.page>=pageInfo.totalPage?'disabled="disabled"':''} class="next-page"><spring:message code="order.nextPage"></spring:message></button>
                    <div class="flower-paging">
                        <button type="button" onclick="shangyiye()" ${pageInfo.page<=1?'disabled="disabled"':''} class="page-turning"> &lt;</button>${pageInfo.page}<button onclick="xiayiye()" ${pageInfo.page>=pageInfo.totalPage?'disabled="disabled"':''} class="page-turning">&gt;</button><spring:message code="order.total"></spring:message><span class="page-total">${pageInfo.totalPage}</span><spring:message code="order.page"></spring:message>
                    </div>
                    <div class="clearfix"></div>
                </div>

            </div>
        </div>
        </c:if>
    <!--用户中心 end-->
    <!--全局-->
    <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/public.js"></script>
    <!--ie789下placeholder不兼容-->
    <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/placeholder.js"></script>
    <!--头部的以图搜图-->
    <%-- <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/uppicFile.js"></script> --%>
    <script>
        $(function () {
            $(".or-right").each(function () {
                $(this).css({
                    "margin-top": $(this).parent(".order-content-wei").height() / 2 - 60
                })
            });

        });
        
        function del(id){
        	window.parent.layer.confirm('<spring:message code="reciveAddress.confirmDeletion"></spring:message>', {
            	  btn: ['<spring:message code="reciveAddress.confirm"></spring:message>','<spring:message code="reciveAddress.cancel"></spring:message>'], //按钮
            	  title:'<spring:message code="reciveAddress.message"></spring:message>'
             	}, function(index){
             		 $.ajax({
           			 url:'${pageContext.request.contextPath }/web/orders/delorders',
           			 async : false,
           			 data: {oId:id},
           			 type : "POST", 
           			 success :function(result){
           			 var status=result.msg.status;
           			 var desc=result.msg.desc;
           			 if(status == 0){
           				 window.parent.layer.msg("<spring:message code='caozuochenggong'></spring:message>", {icon: 1,time: 1000}); 
           				 location.reload(true);
           			 }else if(status == 2){//没登录
           				 window.parent.layer.msg("<spring:message code='weidenglu'></spring:message>", {icon: 0,time: 1000}); 
           			    }else if(status ==1){//失败
           			    	 window.parent.layer.msg("<spring:message code='caozuoshibai'></spring:message>", {icon: 0,time: 1000}); 
           			    }
           			 }
           			 });
             	},function(index){
             		 window.parent.layer.close(index);
             	});
        }
        function shangyiye(){
        	var url="${pageContext.request.contextPath }/web/orders/orderslist?page="+${pageInfo.page-1};
        	location.href=url;
        }
        function xiayiye(){
        	var url="${pageContext.request.contextPath }/web/orders/orderslist?page="+${pageInfo.page+1};
        	location.href=url;
        }
        
    </script>
</body>
</htm>